<%@page import="com.core.utils.GlobalConstants"%>
<%@page import="com.entities.projecttask.actionscript.ActionScriptParserProjectTaskAdd"%>
<%@page import="com.entities.projecttask.list.ProjectTasksListController"%>
<%@page import="com.core.ui.controller.ActionBarController"%>
<%@page import="com.core.managers.SessionManager"%>
<%@taglib prefix="sorokina" uri="/WEB-INF/Sorokina.tld"%>
<script type="text/javascript">
    function deleteTask(taskId){
        var confirmResult = confirm("Are you sure?");
        if (confirmResult){

            jQuery.post('<%=GlobalConstants.SERVLET_TASKDELETE%>',
                    {'id'        : taskId}
                    ,function(data){
                        location.reload();
                    }
            );
            
        }
    }
</script>
<%
	SessionManager.setContext(GlobalConstants.USERCONTEXT_TASKSLIST);
    String projectId = request.getParameter("id");

    ProjectTasksListController projectTasksListController = new ProjectTasksListController();
    projectTasksListController.setProjectId(projectId);

    ActionScriptParserProjectTaskAdd actionScriptParserProjectTaskAdd = new ActionScriptParserProjectTaskAdd();
    actionScriptParserProjectTaskAdd.setProjectId(projectId);

    ActionBarController actionBarController = new ActionBarController();
    actionBarController.setActionScriptParser(actionScriptParserProjectTaskAdd);
%>

<div>

    <sorokina:ActionBarView datasource="<%=actionBarController %>" />
    <sorokina:TableView datasource="<%=projectTasksListController%>" delegate="<%=projectTasksListController%>" />
</div>